//
//  InvitationCardViewController.m
//  TrueLove
//
//  Created by han on 15-1-28.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "InvitationCardViewController.h"
#import "EditViewController.h"
#import "AccountbookViewController.h"
#import "StrategyViewController.h"
#import "LuckDayViewController.h"
@interface InvitationCardViewController ()
@property (nonatomic, retain) UIScrollView *scrollView;
@end

@implementation InvitationCardViewController
- (void)dealloc
{
    [_scrollView release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"请帖";
    //隐藏上方导航栏
//     self.navigationController.navigationBar.translucent = NO;
//    self.view.backgroundColor = [UIColor colorWithRed:237 green:237 blue:237 alpha:0.5];
    // Do any additional setup after loading the view.
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 120, 380, 400)];
    self.scrollView.contentSize = CGSizeMake(220 * 20, 0);
    self.scrollView.pagingEnabled = YES;
    self.scrollView.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:self.scrollView];
    [self showDownButton];
    [self showImageView];
    [self showUpButton];
    [self.scrollView release];
    
    
    
}
//显示上方按钮
- (void)showUpButton
{
    UIButton *luckDayButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [luckDayButton setTitle:@"黄道吉日" forState:UIControlStateNormal];
    [luckDayButton addTarget:self action:@selector(luckDayButton:) forControlEvents:UIControlEventTouchUpInside];
    luckDayButton.frame = CGRectMake(20, 80, 100, 30);
    [self.view addSubview:luckDayButton];
    
    
    UIButton *strategyButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [strategyButton setTitle:@"结婚攻略" forState:UIControlStateNormal];
    [strategyButton addTarget:self action:@selector(strategyButton:) forControlEvents:UIControlEventTouchUpInside];
    strategyButton.frame = CGRectMake(140, 80, 100, 30);
    [self.view addSubview:strategyButton];
    
    
    UIButton *accountbookButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [accountbookButton setTitle:@"礼金账本" forState:UIControlStateNormal];
    [accountbookButton addTarget:self action:@selector(accountbookButton:) forControlEvents:UIControlEventTouchUpInside];
    accountbookButton.frame = CGRectMake(260, 80, 100, 30);
    [self.view addSubview:accountbookButton];
}
//黄道吉日
- (void)luckDayButton:(UIButton *)luckDay
{
    LuckDayViewController *luckDayVC = [[LuckDayViewController alloc] init];
    [self.navigationController pushViewController:luckDayVC animated:YES];
    [luckDayVC release];
}
//结婚攻略
- (void)strategyButton:(UIButton *)strategy
{
    StrategyViewController *strategyVC = [[StrategyViewController alloc] init];
    [self.navigationController pushViewController:strategyVC animated:YES];
    [strategyVC release];
}
//礼金账本
- (void)accountbookButton:(UIButton *)account
{
    AccountbookViewController *accountbookVC = [[AccountbookViewController alloc] init];
    [self.navigationController pushViewController:accountbookVC animated:YES];
    [accountbookVC release];
}
//显示scrollView上的图片
- (void)showImageView
{
    for (NSInteger i = 0; i < 20; i++) {
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(80 , -60, 220, 400)];
        imageView.backgroundColor = [UIColor cyanColor];
        [self.scrollView addSubview:imageView];
        
        UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(460 , -60, 220, 400)];
        imageView1.backgroundColor = [UIColor cyanColor];
        [self.scrollView addSubview:imageView1];
        
        [imageView release];
        [imageView1 release];
        
    }

}
//显示下方按钮
- (void)showDownButton
{
    //编辑的按钮
    UIButton *editButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [editButton setBackgroundImage:[UIImage imageNamed:@"iconfont-bianji.png"] forState:UIControlStateNormal];
    [editButton addTarget:self action:@selector(editButton:) forControlEvents:UIControlEventTouchUpInside];
    editButton.frame = CGRectMake(80, 520, 30, 30);
    //编辑按钮的弧度
//    editButton.layer.cornerRadius = 100;
    [self.view addSubview:editButton];
    
    //照相的按钮
    UIButton *photoButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [photoButton setBackgroundImage:[UIImage imageNamed:@"iconfont-zhaoxiangji.png"] forState:UIControlStateNormal];
    [photoButton addTarget:self action:@selector(photoButton:) forControlEvents:UIControlEventTouchUpInside];
    photoButton.frame = CGRectMake(140, 520, 30, 30);
    [self.view addSubview:photoButton];
    
    //保存的按钮
    UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [saveButton setBackgroundImage:[UIImage imageNamed:@"iconfont-baocun.png"] forState:UIControlStateNormal];
    [saveButton addTarget:self action:@selector(saveButton:) forControlEvents:UIControlEventTouchUpInside];
    saveButton.frame = CGRectMake(200, 520, 30, 30);
    [self.view addSubview:saveButton];
    
    //分享的按钮
    UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [shareButton setBackgroundImage:[UIImage imageNamed:@"iconfont-fenxiang.png"] forState:UIControlStateNormal];
    [shareButton addTarget:self action:@selector(shareButton:) forControlEvents:UIControlEventTouchUpInside];
    shareButton.frame = CGRectMake(260, 520, 40, 40);
    [self.view addSubview:shareButton];
    
    
}

//分享的按钮
- (void)shareButton:(UIButton *)shareButton
{
    
}
//保存的按钮
- (void)saveButton:(UIButton *)saveButton
{
    
}
//照相的按钮
- (void)photoButton:(UIButton *)photoButton
{
    
}
//编辑的按钮
- (void)editButton:(UIButton *)editButton
{
    EditViewController *editVC = [[EditViewController alloc] init];
    [self.navigationController pushViewController:editVC animated:YES];
    [editVC release];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
